/*

    This file is part of x86_ldasm.

    x86_ldasm is an x86-64 instruction length disassembler
    
    Copyright 2019 / the`janitor / < email: base64dec(dGhlLmphbml0b3JAcHJvdG9ubWFpbC5jb20=) >

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

*/
#include "x86_ldasm.h"
#include "x86_ldasm_tables.h"

/****************************************************************************

    One-byte tables

****************************************************************************/

uint8_t x86_table[7 * 256] =
{
    /************************************************ 

        one-byte table
    
    ************************************************/

    /* 00h */
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_B,
    F_Z,
    F_NONE,
    F_NONE,
    
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_B,
    F_Z,
    F_NONE,

    /* 0Fh: two-byte table escape */
    F_NONE,

    /* 10h */
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_B,
    F_Z,
    F_NONE,
    F_NONE,
    
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_B,
    F_Z,
    F_NONE,
    F_NONE,

    /* 20h */
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_B,
    F_Z,
    
    /* 26h: prefix (prefixes should have already been parsed) */
    F_NONE,
    F_NONE,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_B,
    F_Z,

    /* 2Eh: prefix (prefixes should have already been parsed) */
    F_NONE,
    F_NONE,

    /* 30h */
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_B,
    F_Z,

    /* 36h: prefix (prefixes should have already been parsed) */
    F_NONE,

    F_NONE,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_B,
    F_Z,

    /* 3Eh: prefix (prefixes should have already been parsed) */
    F_NONE,
    F_NONE,

    /* 40h: rex in 64-bit mode should have already been taken care of */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 50h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 60h - 61h: pusha/pushad and popa/popad depending on operand size */
    F_NONE,
    F_NONE,
    F_MODRM,

    /* 63h: ARPL I64 and MOVSXD O64 */
    F_MODRM,

    /* 64h - 67h: prefix (prefixes should have already been parsed) */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_Z | F_D64,
    F_MODRM | F_Z,
    F_B,
    F_MODRM | F_B,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 70h */
    F_B,
    F_B,
    F_B,
    F_B,
    F_B,
    F_B,
    F_B,
    F_B,
    F_B,
    F_B,
    F_B,
    F_B,
    F_B,
    F_B,
    F_B,
    F_B,

    /* 80h: immediate group 1 */
    F_MODRM | F_B,
    F_MODRM | F_Z,
    F_MODRM | F_B,
    F_MODRM | F_B,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,

    /* 90h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_AP,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    
    /* A0h */
    F_O,
    F_O,
    F_O,
    F_O,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_B,
    F_Z,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* B0h */
    F_B,
    F_B,
    F_B,
    F_B,
    F_B,
    F_B,
    F_B,
    F_B,
    
    F_V,
    F_V,
    F_V,
    F_V,
    F_V,
    F_V,
    F_V,
    F_V,

    /* C0h */
    F_MODRM | F_B,
    F_MODRM | F_B,
    F_W,
    F_NONE,
    F_MODRM,
    F_MODRM,

    /* C6h - C7h: group 11 */
    F_MODRM | F_B,
    F_MODRM | F_Z,

    /* C8h */
    F_W | F_B,
    F_NONE,
    F_W,
    F_NONE,
    F_NONE,
    F_B,
    F_NONE,
    F_NONE,

    /* D0h */
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_B,
    F_B,
    F_NONE,
    F_NONE,

    /* D8h: x87 FPU co-processor escape */
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,

    /* E0h */
    F_B,
    F_B,
    F_B,
    F_B,

    /* E4h */
    F_B,
    F_B,
    F_B,
    F_B,
    
    F_Z | F_F64,
    F_Z | F_F64,
    F_AP,
    F_B,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* F0h: prefix (prefixes should have already been parsed) */
    F_NONE, /* lock */
    F_NONE, /* single-step exception (int 01) */
    F_NONE, /* repne/xacquire */
    F_NONE, /* rep/xrelease */

    /* F4h */
    F_NONE,
    F_NONE,

    /* F6h - F7h: unary group 3 */
    F_MODRM, // except for modr/m reg == [0,1]: F_MODRM | F_B
    F_MODRM, // except for modr/m reg == [0,1]: F_MODRM | F_Z

    /* F8h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* FEh - FFh: inc/dec group 4,5 */
    F_MODRM,
    F_MODRM,

    /************************************************ 

        two-bytes table (0f) 
    
    ************************************************/

    /* 00h */
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_MODRM,
    F_NONE,

    /* 0Fh: AMD only, 3DNow! escape */
    F_MODRM | F_B,
    
    /* 10h */
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,

    /* 20h */
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,

    /* 30h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 38h: three-byte table escape */
    F_NONE,
    F_NONE,

    /* 3Ah: three-byte table escape */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 40h */
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,

    /* 50h */
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,

    /* 60h */
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_NONE,
    F_NONE,
    F_MODRM,
    F_MODRM,

    /* 70h */
    F_MODRM | F_B,
    F_MODRM | F_B,
    F_MODRM | F_B,
    F_MODRM | F_B,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_NONE,
    F_MODRM, // except for F2/66 OP(Vss, Uss, Ib, Ib))
    F_MODRM,
    F_NONE,
    F_NONE,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,

    /* 80h */
    F_Z | F_F64,
    F_Z | F_F64,
    F_Z | F_F64,
    F_Z | F_F64,
    F_Z | F_F64,
    F_Z | F_F64,
    F_Z | F_F64,
    F_Z | F_F64,
    F_Z | F_F64,
    F_Z | F_F64,
    F_Z | F_F64,
    F_Z | F_F64,
    F_Z | F_F64,
    F_Z | F_F64,
    F_Z | F_F64,
    F_Z | F_F64,

    /* 90h */
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,

    /* A0h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_MODRM,
    F_MODRM | F_B,
    F_MODRM,

    /* A6h */
    F_NONE,
    F_NONE,

    /* A8h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_MODRM,
    F_MODRM | F_B,
    F_MODRM,

    /* AEh */
    F_MODRM,

    /* AFh */
    F_MODRM,

    /* B0h */
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM | F_B,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,

    /* C0h */
    F_MODRM,
    F_MODRM,
    F_MODRM | F_B,
    F_MODRM,
    F_MODRM | F_B,
    F_MODRM | F_B,
    F_MODRM | F_B,
    F_MODRM,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* D0h */
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,

    /* E0h */
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,

    /* F0h */
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,

    /************************************************ 

        three-bytes table (0f 38) 
    
    ************************************************/

    /* 00h */
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,

    /* 10h */
    F_MODRM,
    F_NONE,
    F_NONE,
    F_MODRM | F_B,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_NONE,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_NONE,


    /* 20h */
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_NONE,
    F_NONE,

    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,


    /* 30h */
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,

    /* 40h */
    F_MODRM,
    F_MODRM,
    F_NONE,
    F_NONE,
    F_NONE,
    F_MODRM,
    F_MODRM,
    F_MODRM,
     
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 50h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 60h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 70h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_MODRM,
    F_MODRM,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 80h */
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_MODRM,
    F_NONE,
    F_MODRM,
    F_NONE,

    /* 90h */
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_NONE,
    F_NONE,
    F_MODRM,
    F_MODRM,
    
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,

    /* A0h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_MODRM,
    F_MODRM,

    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,

    /* B0h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_MODRM,
    F_MODRM,

    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,

    /* C0h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* D0h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,


    /* E0h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* F0h */
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_NONE,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /************************************************ 

        three-bytes table (0f 3a) 
    
    ************************************************/

    /* 00h */
    F_MODRM | F_B,
    F_MODRM | F_B,
    F_MODRM | F_B,
    F_NONE,
    F_MODRM | F_B,
    F_MODRM | F_B,
    F_MODRM | F_B,
    F_NONE,

    F_MODRM | F_B,
    F_MODRM | F_B,
    F_MODRM | F_B,
    F_MODRM | F_B,
    F_MODRM | F_B,
    F_MODRM | F_B,
    F_MODRM | F_B,
    F_MODRM | F_B,

    /* 10h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_MODRM | F_B,
    F_MODRM | F_B,
    F_MODRM | F_B,
    F_MODRM | F_B,

    F_MODRM | F_B,
    F_MODRM | F_B,
    F_NONE,
    F_NONE,
    F_NONE,
    F_MODRM | F_B,
    F_NONE,
    F_NONE,

    /* 20h */
    F_MODRM | F_B,
    F_MODRM | F_B,
    F_MODRM | F_B,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 30h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_MODRM | F_B,
    F_MODRM | F_B,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 40h */
    F_MODRM | F_B,
    F_MODRM | F_B,
    F_MODRM | F_B,
    F_NONE,
    F_MODRM | F_B,
    F_NONE,
    F_MODRM | F_B,
    F_NONE,

    F_NONE,
    F_NONE,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 50h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,

    /* 60h */
    F_MODRM | F_B,
    F_MODRM | F_B,
    F_MODRM | F_B,
    F_MODRM | F_B,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,

    /* 70h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,

    /* 80h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 90h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* A0h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* B0h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* C0h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* D0h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_MODRM | F_B,


    /* E0h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* F0h */
    F_MODRM | F_B,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /************************************************ 

        XOP 08
    
    ************************************************/

    /* 00h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 10h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 20h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 30h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 40h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 50h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 60h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 70h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 80h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_MODRM,
    F_MODRM,
    F_MODRM,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_MODRM,
    F_MODRM,

    /* 90h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_MODRM,
    F_MODRM,
    F_MODRM,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_MODRM,
    F_MODRM,

    /* A0h */
    F_NONE,
    F_NONE,
    F_MODRM,
    F_MODRM,
    F_NONE,
    F_NONE,
    F_MODRM,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* B0h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_MODRM,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* C0h */
    F_MODRM | F_B,
    F_MODRM | F_B,
    F_MODRM | F_B,
    F_MODRM | F_B,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_MODRM | F_B,
    F_MODRM | F_B,
    F_MODRM | F_B,
    F_MODRM | F_B,

    /* D0h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* E0h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_MODRM | F_B,
    F_MODRM | F_B,
    F_MODRM | F_B,
    F_MODRM | F_B,

    /* F0h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /************************************************ 

        XOP 09
    
    ************************************************/

    /* 00h */
    F_NONE,
    F_MODRM,
    F_MODRM,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 10h */
    F_NONE,
    F_NONE,
    F_MODRM,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 20h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 30h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 40h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 50h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 60h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 70h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 80h */
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 90h */
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,

    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* A0h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* B0h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* C0h */
    F_NONE,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_NONE,
    F_NONE,
    F_MODRM,
    F_MODRM,

    F_NONE,
    F_NONE,
    F_NONE,
    F_MODRM,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* D0h */
    F_NONE,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_NONE,
    F_NONE,
    F_MODRM,
    F_MODRM,

    F_NONE,
    F_NONE,
    F_NONE,
    F_MODRM,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* E0h */
    F_NONE,
    F_MODRM,
    F_MODRM,
    F_MODRM,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* F0h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /************************************************ 

        XOP 0a
    
    ************************************************/

    /* 00h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 10h */
    F_MODRM | F_D,
    F_NONE,
    F_MODRM | F_D,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 20h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 30h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 40h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 50h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 60h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 70h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 80h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* 90h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* A0h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* B0h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* C0h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* D0h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* E0h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    /* F0h */
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,

    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE,
    F_NONE
};